<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
#bigbox{width:600px;height:1000px;border:black 2px solid;}
#box1{width:100px;height:400px;background:red; float:left;}
#box2{width:200px;height:200px;background:yellow; float:left;}
#box3{width:300px;height:300px;background:blue; float:left;}
/*设置浮动元素 如果前面没有浮动的元素,那么就会去寻找父元素的边框,如果前面有浮动的元素,后一个浮动的元素就会去寻找前一个有设置浮动元素的边框*/
</style>
</head>

<body>
<div id="bigbox">
<div id="box1">BOX1</div>
<div id="box2">BOX2</div>
<div id="box3">BOX3</div>
</div>
</body>
</html>
